var myChart1 = echarts.init(document.getElementById('projectRepairChart'));
function  deviceError(data) {
	var option =  {
        title:{
            text:'本月各设备告警情况',
            textStyle:{
                color:'#33FFFF'
            },
            left:'center'
        },
        color:["#f6d54a","#f69846","#44aff0","#45dbf7","#f845f1","#ad46f3","#5045f6","#4777f5"],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data: data.errorGroup,
            top:'30px',
            textStyle:{
                color:'#fff'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis:  {
            type: 'value',
            axisLabel:{
                color:'#fff'
            },
            splitLine:{
                show:false
            },
        },
        yAxis: {
            type: 'category',
            axisLabel:{
                color:'#fff'
            },
            data: data.deviceName,
        },
        series: []
    };
    for (let i in data.errorGroup){
        option.series.push({
            name: data.errorGroup[i],
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: false,
                    position: 'insideRight'
                }
            },
            data: data.errorData[i]
        })
    };
    return option;

}

/* $(function(){
	var dataJson = '48,46,43,49,45,41,47,48,49,40,41,48,48,49,47,45,48,48,49,42,47,42,43,50,45,49,47,44,49,51,48';
	var list = dataJson.split(',');
	var sum = 0;
	for(var i = 0;i<list.length;i++){
			sum += parseInt(list[i]);
	}
	console.log("sum:"+sum);
}) */
